const app = getApp()
import { HiddenCall } from '../../request/api'
const request = new HiddenCall
Page({
  data: {
    template: [],
    index: 0
  },
  onLoad: function (options) {
    let data = JSON.parse(options.phoneSelect)
    this.setData({
      listPhone: data.res,
      msgCallCode: data.msgCallCode,
      callPhoneList: data.callPhoneList,
      msgCallType: data.msgCallType
    })
    request.lengthNumber(app.globalData.telephone).then((res) => {
      // this.setData({ template: res })
      res.result.forEach((el, i) => {
        this.data.template[i] = el.directNumber
      })
      this.setData({ template: this.data.template})
    })
  }
})